package com.hongyuan.sellfitness.ui.find.view_mode;

import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.databinding.ObservableField;

import com.hongyuan.mvvmhabitx.binding.command.BindingAction;
import com.hongyuan.mvvmhabitx.binding.command.BindingCommand;
import com.hongyuan.sellfitness.base.ItemViewModel;
import com.hongyuan.sellfitness.ui.find.activity.CirclePeopleActivity;

public class CircleDetailTopItemViewModel extends ItemViewModel<CircleDetailViewModel> {

    public ObservableField<Object> entity = new ObservableField<>();

    public CircleDetailTopItemViewModel(@NonNull CircleDetailViewModel viewModel, Object bean) {
        super(viewModel);
        entity.set(bean);
    }

    //参与的人
    public BindingCommand goUsers = new BindingCommand(new BindingAction() {
        @Override
        public void call() {
            if(!(entity.get() instanceof String)){
                Bundle bundle = new Bundle();
                bundle.putString("circle_categoryid",String.valueOf(viewModel.entity.get().getCategory_id()));
                viewModel.startActivity(CirclePeopleActivity.class,bundle);
            }
        }
    });

}
